<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<title>Web Log</title>
</head>

<%@ include file="header.jsp"%>

<script type="text/javascript">
	$(function() {
		$('#build-pop').button();
		initCKeditor();
		postDialog();
		tagDialog();
		fetchBlogPostsFromRange();
		fetchTags(); // this is for the Create Post form Tags. Getting messy.
	})
</script>

<body>
	<%@ include file="navigation.jsp"%>
	<div class="body-wrapper">
		<div id="inner-wrapper" class="group main-cotent">
			<%@ include file="blog-aside.jsp"%>
			
			<section id="fetch-blog-posts" class="section-home blog-section">
			<div id="loading-blogposts">Loading... <img src="images/ajax-loader.gif"/></div>
			</section>
			<c:if test="${isAdmin}">
			<p class="post-success"></p>
			<div class="controls">
				<button id="new-post">Create a Post</button>
				<button id="new-tag">Create a Tag</button>
				<button id="build-pop" onclick="javascript:buildPostsPopularity('.post-success')">Build Popularity</button>
			</div>
			</c:if>
			<div id="post-form" title="Create a Post">
				<p class="validateTips">All form fields are required.</p>
				<form>
					<fieldset>
						<label class="form-style" for="postTitle">Title:</label> <input
							id="title" name="title" type="text" size="60" />
						<div id="tags"></div>
						<label class="form-style" for="postContent">Post Your Blog
							Post:</label>
						<textarea id="postTextArea" name="postTextArea" cols="10" rows="5"
							class="text ui-widget-content ui-corner-all"></textarea>
					</fieldset>
				</form>
			</div>
			<div id="tag-form" title="Create a Tag">
				<p class="validateTips">All form fields are required.</p>
				<form>
					<fieldset>
						<label class="form-style" for="tag">Tag:</label> 
						<input id="tag" name="tag" type="text" size="60" />
					</fieldset>
				</form>
			</div>
		</div>
	</div>
	<%@ include file="footer.jsp"%>
</body>